﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_CMT : System.Web.UI.UserControl
{
    AccessData ac = new AccessData();
    int masp;
    string ten;
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            masp = int.Parse(Request.QueryString.Get("matin"));
            ten = Request.Cookies["LoginUser"]["HoTen"].ToString();
        }
        catch 
        {
            
           
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
    
        ac.ExeCuteNonquery("insert into BinhLuanDienDan(NoiDung,Ten,IDBanTin) values('" + TextBox1.Text + "','" + ten + "','" + masp + "')");
        Response.Redirect(string.Format("ChiTietDienDan.aspx?matin={0}",masp));
    }
}